; *** Mu Torere
; *** Copyright 1998-2002 Zillions Development
; v.2.0

; You need to purchase Zillions of Games to load this rules file
; Visit the Zillions web site at http://www.zillions-of-games.com
(translate
 ("Black" "黑方") ("White" "白方")
 ("kawai-1" "角1") ("kawai-2" "角2") ("kawai-3" "角3") ("kawai-4" "角4")
 ("kawai-5" "角5") ("kawai-6" "角6") ("kawai-7" "角7") ("kawai-8" "角8")
 ("Putahi" "中心") ("Perepere" "棋子") ("Stone" "棋子")
)

(variant
   (title "Mu Torere")
   (description "首先，为什么没翻棋名，因为我也不知道该叫啥。。。\
棋盘呈八角形，中心有一空位。\
双方交替移动棋子，可以移动到相邻角，或把中心棋子移动到角上。\也可将角上的棋子移至中心，但必须是相邻角有对方棋子的场合才可这么做。\")
   (history "This is a children's game played by New Zealand's Maori.  It was often
      played on the ground using a board marked with a pointed stick, drawn on stone
      with charcoal, or carved into the green bark of a Totara evergreen tree.")
   (strategy "If the opponent has 3 men in a row around the edge, you must either
      get or keep possession of the putahi.  Possession of the putahi is essential
      to any victory.  However, if both players are careful the game should be a draw.
      Some sample positions and analysis are given in Robert McConville's `The History
      of Board Games`.")
   (board
      (image "images\Mu_Torere\mutorebd.bmp" "images\Mu_Torere\mutorebd2.bmp")
      (links clockwise        (kawai-1 kawai-2) (kawai-2 kawai-3) (kawai-3 kawai-4)
                              (kawai-4 kawai-8) (kawai-8 kawai-7) (kawai-7 kawai-6)
                              (kawai-6 kawai-5) (kawai-5 kawai-1)
      )
      (links counterclockwise (kawai-2 kawai-1) (kawai-3 kawai-2) (kawai-4 kawai-3)
                              (kawai-8 kawai-4) (kawai-7 kawai-8) (kawai-6 kawai-7)
                              (kawai-5 kawai-6) (kawai-1 kawai-5)
      )
      (links into  (kawai-1 Putahi) (kawai-2 Putahi) (kawai-3 Putahi) (kawai-4 Putahi)
                   (kawai-5 Putahi) (kawai-6 Putahi) (kawai-7 Putahi) (kawai-8 Putahi)
	  )
      (positions
		 (kawai-1  13  61  33  81)
	     (kawai-2  53  18  73  38)
		 (kawai-3 137  19 157  39)
		 (kawai-4 177  62 197  82)
		 (kawai-5  13 123  33 143)
		 (kawai-6  54 165  74 185)
		 (kawai-7 138 165 158 185)
		 (kawai-8 178 123 198 143)
		 (Putahi   96  93 117 113) ; center
      )
   )

   (board-setup
      (White (Perepere kawai-1 kawai-2 kawai-3 kawai-4) )
      (Black (Perepere kawai-5 kawai-6 kawai-7 kawai-8) )
   )

   (piece (name Stone))

   (piece
      (name Perepere)
      (image White "images\Mu_Torere\StoneW.bmp"
             Black "images\Mu_Torere\StoneB.bmp")
	  (help "棋子可以移动至相邻角或从中心移至任一角，在相邻角有对方棋子的场合才可移至中心。")
      (moves
       (
         (if (position? Putahi)
            (if (empty? kawai-1) kawai-1 add Putahi)
            (if (empty? kawai-2) kawai-2 add Putahi)
            (if (empty? kawai-3) kawai-3 add Putahi)
            (if (empty? kawai-4) kawai-4 add Putahi)
            (if (empty? kawai-5) kawai-5 add Putahi)
            (if (empty? kawai-6) kawai-6 add Putahi)
            (if (empty? kawai-7) kawai-7 add Putahi)
            (if (empty? kawai-8) kawai-8 add Putahi)
          else
	        (if (empty? clockwise) clockwise add counterclockwise)
	        (if (empty? counterclockwise) counterclockwise add clockwise)
	        (if (and (empty? into) (or (enemy? clockwise) (enemy? counterclockwise)))
               into add
            )
         )
       )
      )
   )
)

(variant (title "-")) ;--------------------------------

(game
   (title "区字棋（憋死牛）")
   (description "每方两枚棋子，沿线移动，无法移动者输。")
   (history "This game is played in China, where it is called Pong hau k'i.  In
      Korea it is called Ou-moul-ko-no.")
   (strategy "This is an easy draw ...as long as you don't fall into any traps!")
   (option "prevent flipping" true)
   (players Black White)
   (turn-order Black White)
   (board
      (image "images\Mu_Torere\Pong_Hau_Ki.bmp" "images\Mu_Torere\Pong_Hau_Ki_2.bmp")
      (links dir1 (top-left middle) (top-right middle)
                  (bottom-left middle) (bottom-right middle)
				  (middle top-left))
	  (links dir2 (top-left bottom-left) (top-right bottom-right)
	              (bottom-left top-left) (bottom-right top-right)
				  (middle top-right))
      (links dir3 (bottom-left bottom-right) (bottom-right bottom-left)
	              (middle bottom-left))
      (links dir4 (middle bottom-right))
      (positions
		 (top-left      16  14  48  48)
	     (top-right    139  14 171  48)
		 (middle        78  78 110 110)
		 (bottom-left   16 142  48 176)
		 (bottom-right 140 142 172 176)
      )
   )

   (board-setup
      (White (Stone top-left top-right) )
      (Black (Stone bottom-left bottom-right) )
   )

   (piece
      (name Stone)
      (image White "images\Mu_Torere\StoneW.bmp"
             Black "images\Mu_Torere\StoneB.bmp")
	  (help "棋子可以沿线移动。")
      (moves
	     (dir1 (verify empty?) add)
		 (dir2 (verify empty?) add)
		 (dir3 (verify empty?) add)
		 (dir4 (verify empty?) add)
      )
   )
   (loss-condition (White Black) stalemated)
)

(variant
   (title "区字棋二")
   (description "每方3枚棋子，先依次落在盘上，全部落子完毕之后方可沿线移动。")
   (history "This game is also played in China.  It is a variation on
      Pong hau k'i, which is known as Ou-moul-ko-no in Korea.")
   (strategy "It's important to watch out, even in the dropping stage.  One
      thing to notice about this game is that the center is
      connected to all six of the other points.  Since there are only six stones,
	  a stone in the center will always have a free space to move to.  Thus
	  in any winning position, the winner will have a piece in the center.")
   (move-priorities place-stone move-stone)
   (board
      (image "images\Mu_Torere\Pong_Hau_Ki2.bmp" "images\Mu_Torere\Pong_Hau_Ki2_2.bmp")
      (links dir1 (top-left middle) (top-right middle)
                  (bottom-left middle) (bottom-right middle)
				  (middle-left middle) (middle-right middle)
				  (middle top-left))
	  (links dir2 (top-left middle-left) (top-right middle-right)
                  (middle-left bottom-left) (middle-right bottom-right)
	              (bottom-left bottom-right) (bottom-right bottom-left)
				  (middle top-right))
      (links dir3 (bottom-left middle-left) (bottom-right middle-right)
	              (middle-left top-left) (middle-right top-right)
	              (middle bottom-left))
      (links dir4 (middle bottom-right))
	  (links dir5 (middle middle-left))
	  (links dir6 (middle middle-right))
      (positions
		 (top-left      16  14  48  48)
	     (top-right    139  14 171  48)
		 (middle-left   15  77  48 110)
		 (middle        78  77 110 110)
		 (middle-right 140  77 173 110)
		 (bottom-left   16 142  48 176)
 		 (bottom-right 140 142 172 176)
     )
   )

   (board-setup
      (White (Stone off 3) )
      (Black (Stone off 3) )
   )

   (piece
      (name Stone)
      (image White "images\Mu_Torere\StoneW.bmp"
             Black "images\Mu_Torere\StoneB.bmp")
	  (help "棋子可以沿线移动。")
      (drops
         (move-type place-stone)
         ((verify empty?) add)
      )
      (moves
         (move-type drop-stone)
	     (dir1 (verify empty?) add)
		 (dir2 (verify empty?) add)
		 (dir3 (verify empty?) add)
		 (dir4 (verify empty?) add)
		 (dir5 (verify empty?) add)
		 (dir6 (verify empty?) add)
      )
   )
)

